#include <bits/stdc++.h>
using namespace std;

int solve() {
    int n;
    cin >> n;
    int a[n];
    for (int& x : a)
        cin >> x;
    int f0[n], f1[n];

    f0[0] = 1;
    f1[0] = 1;

    for (int i = 1; i < n; i++) {
        f0[i] = f0[i - 1] + ((a[i - 1] == a[i]) ? 0 : 1);
        f1[i] = f1[i - 1] + ((a[i - 1] == a[i]) ? 0 : 1);
    }
    return 0;
}

int main() {
    cout << solve() << endl;
    return 0;
}